home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / ODF / Examples / Button / Include / Actions.h next >
Encoding:
Text File  |  1995-11-08  |  3.6 KB  |  131 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                Actions.h
  4. //    Release Version:    $ 1.0d11 $
  5. //
  6. //    Author:                Jim Lloyd
  7. //
  8. //    Copyright:    © 1995 by Apple Computer, Inc., all rights reserved.
  9. //
  10. //========================================================================================
  11.  
  12. #ifndef ACTIONS_H
  13. #define ACTIONS_H
  14.  
  15. #ifndef FWRUNTYP_H
  16. #include "FWRunTyp.h"
  17. #endif
  18.  
  19. //========================================================================================
  20. //    Forward declarations
  21. //========================================================================================
  22.  
  23. class ODStorageUnit;
  24.  
  25. //========================================================================================
  26. //    class CAction
  27. //========================================================================================
  28.  
  29. class FW_CLASS_ATTR CAction
  30. {
  31. //----------------------------------------------------------------------------------------
  32. //    Initialization/Destruction
  33. //
  34. public:    
  35.     CAction();
  36.     virtual ~CAction();
  37.     
  38. //----------------------------------------------------------------------------------------
  39. //    Action protocol
  40. //
  41. public:    
  42.     virtual void Internalize(Environment* ev, 
  43.                         ODStorageUnit* storage) = 0;
  44.                         
  45.     virtual void Externalize(Environment* ev, 
  46.                         ODStorageUnit* storage) = 0;
  47.     
  48.     virtual void DoIt() = 0;
  49. };
  50.  
  51. //========================================================================================
  52. //    class CSoundAction
  53. //========================================================================================
  54.  
  55. class FW_CLASS_ATTR CSoundAction : public CAction
  56. {
  57. //----------------------------------------------------------------------------------------
  58. //    Initialization/Destruction
  59. //
  60. public:
  61.     CSoundAction();
  62.     virtual ~CSoundAction();
  63.     
  64.     static FW_Boolean IsInStorage(
  65.                 Environment* ev, ODStorageUnit* storage);
  66.     
  67. //----------------------------------------------------------------------------------------
  68. //    Action protocol
  69. //
  70. public:
  71.     virtual void Internalize(Environment* ev, 
  72.                         ODStorageUnit* storage);
  73.     virtual void Externalize(Environment* ev,
  74.                          ODStorageUnit* storage);
  75.     virtual void DoIt();
  76.  
  77. //----------------------------------------------------------------------------------------
  78. //    Private implementation
  79. //
  80. private:
  81.     void InternalizeSound(Environment* ev, 
  82.                         ODStorageUnit* storage);
  83.     void InternalizeSoundFile(Environment* ev, 
  84.                         ODStorageUnit* storage);
  85.     
  86.     Handle fSoundHandle;
  87. };
  88.  
  89. //========================================================================================
  90. //    class CScriptAction
  91. //========================================================================================
  92.  
  93. class FW_CLASS_ATTR CScriptAction : public CAction
  94. {
  95. public:    
  96. //----------------------------------------------------------------------------------------
  97. //    Initialization/Destruction
  98. //
  99.     CScriptAction();
  100.     virtual ~CScriptAction();
  101.     
  102.     static FW_Boolean IsInStorage(
  103.                         Environment* ev, 
  104.                         ODStorageUnit* storage);
  105.     
  106. //----------------------------------------------------------------------------------------
  107. //    Action protocol
  108. //
  109. public:
  110.     virtual void Internalize(Environment* ev, 
  111.                         ODStorageUnit* storage);
  112.     virtual void Externalize(Environment* ev, 
  113.                         ODStorageUnit* storage);
  114.     
  115.     virtual void DoIt();
  116.  
  117. //----------------------------------------------------------------------------------------
  118. //    Private implementation
  119. //
  120. private:
  121.     void InternalizeScript(Environment* ev, 
  122.                         ODStorageUnit* storage);
  123.     void InternalizeScriptFile(Environment* ev, 
  124.                         ODStorageUnit* storageUnit);
  125.     static void LoadAndExecuteScript(Handle scriptData);
  126.  
  127.     Handle fScriptHandle;
  128. };
  129.  
  130. #endif
  131.